home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / surfmodl / surfm203.arc / SURFSRC.ARC / INLIMITS.INC < prev    next >
Text File  |  1987-01-05  |  897b  |  39 lines

  1. function INLIMITS (X, Y, Surf: integer): boolean;
  2. { Check to see if point (X,Y) is within the limits of surface Surf. }
  3.  
  4. var Xmin, Xmax, Ymin, Ymax: integer;
  5.     Node: integer;
  6.     Vert: integer;
  7.     Xt, Yt: integer;
  8.  
  9. begin
  10. {$ifdef BIGMEM}
  11. with ptrd^ do with ptre^ do with ptrh^ do
  12. begin
  13. {$endif}
  14.   Xmin := 9999;
  15.   Xmax := -9999;
  16.   Ymin := 9999;
  17.   Ymax := -9999;
  18.   for Vert := 1 to Nvert[Surf] do begin
  19.     Node := konnec (Surf, Vert);
  20.     Xt := round (Xtran[Node]);
  21.     Yt := round (Ytran[Node]);
  22.     if (Xt < Xmin) then
  23.       Xmin := Xt;
  24.     if (Xt > Xmax) then
  25.       Xmax := Xt;
  26.     if (Yt < Ymin) then
  27.       Ymin := Yt;
  28.     if (Yt > Ymax) then
  29.       Ymax := Yt;
  30.   end;
  31.   if (X >= Xmin) and (X <= Xmax) and (Y >= Ymin) and (Y <= Ymax) then
  32.     Inlimits := TRUE
  33.   else
  34.     Inlimits := FALSE;
  35. {$ifdef BIGMEM}
  36. end; {with}
  37. {$endif}
  38. end; { function INLIMITS }
  39.